<div class="title">修改商品</div>
<div class="top-button">
	修改商品分类：<select id="category">
		<option value="0">未分类</option>
		<foreach name="category" item="v">
			<option value="{$v.id}" <eq name="v.id" value="$cid">selected</eq>>{:str_repeat('— ',$v['level'])}{$v.name}</option>
		</foreach>
	</select>
	<a href="{:U('Product/index',array('cid'=>$cid,'p'=>$p))}" class="light">返回商品列表</a>
</div>
<present name="success"><div class="mssage">修改成功。</div></present>
<div class="list auto">
	<form method="post" enctype="multipart/form-data">
	<input type="hidden" name="id" value="{$product.id}">
	<table class="t2 t4">
		<tr><th>商品名称：</th><td><input type="text" name="name" value="{$product.name}" class="big">（必填）</td></tr>
		<tr><th>产品编号：</th><td><input type="text" name="sn" value="{$product.sn}"></td></tr>

		<tr><th>所属大州：</th><td>
		<select name="continent" id="continent">
			<option></option> 
			<foreach name="continent" item="v">
				<option value={$v}
				<if condition="$product.continent eq $v">selected</if>
				>{$v}</option>
			</foreach>
		</select>（必填）</td></tr>
		<tr><th>国家或地区：</th><td><input type="text" name="country" value="{$product.country}" class="big">（必填）</td></tr>
		<tr><th>行程天数：</th><td>
		<select name="days" id="days">
			<option></option> 
			<foreach name="days" item="v">
				<option value={$v}
				<if condition="$product.days eq $v">selected</if>
				>{$v}</option>
			</foreach>
		</select>（线路/邮轮必填）</td></tr>
		
		<if condition="$cid eq 2 ">
		<!--线路必填 start -->
		<tr><th></th><td><b>以下为线路必填：</b></td></tr>
		<tr class="bg-grey"><th>所在城市：</th><td><input type="text" name="city" value="{$product.city}" class="big"></td></tr>
		
		<tr class="bg-grey"><th>产品主题：</th><td>
		<select name="detail_property">
			<option></option> 
			<foreach name="detail_property" item="v">
				<option value={$v}
				<if condition="$product.detail_property eq $v">selected</if>
				>{$v}</option>
			</foreach>
		</select></td></tr>
		<!--线路必填 end -->
		</if>
		
		<if condition="$cid eq 1 ">
		<!--签证必填 start -->
		<tr><th></th><td><b>以下为签证必填：</b></td></tr>
		<tr class="bg-grey"><th>护照签发地：</th><td><input type="text" name="place_of_issue" value="{$product.place_of_issue}" class="big">（签证必填，此处可从下列地区中进行多选，填写时请用逗号隔开
		）</td></tr>
		<tr class="bg-grey"><th></th><td>如：○安徽 ○北京 ○福建 ○甘肃 ○广东 ○广西 ○贵州
            ○海南 ○河北 ○河南 ○黑龙江 ○湖北 ○湖南 ○吉林
            ○江苏 ○江西 ○辽宁 ○内蒙古 ○宁夏 ○青海 ○山东
            ○山西 ○陕西 ○上海 ○四川 ○天津 ○西藏 ○新疆
            ○云南 ○浙江 ○重庆 ○其他国家或地区
		<td></tr>
		<tr class="bg-grey"><th>签证代办类型：</th><td>
		<select name="visa_type" id="visa_type">
			<option></option> 
			<foreach name="visa_type" item="v">
				<option value={$v}
				<if condition="$product.visa_type eq $v">selected</if>
				>{$v}</option>
			</foreach>
		</select>
		（签证必填）</td></tr>
		<tr class="bg-grey"><th>送签地：</th><td><input type="text" name="sent_visa_place" value="{$product.sent_visa_place}" class="big">（签证必填，自定义）</td></tr>
		<tr class="bg-grey"><th></th><td>如：上海、北京、广州、武汉、成都、沈阳、香港等城市名称<td></tr>
		<!--签证必填 end  -->
		</if>
		
		<if condition="$cid eq 3 ">
		<!--邮轮必填 start -->
		<tr><th></th><td><b>以下为邮轮必填：</b></td></tr>
		<tr class="bg-grey"><th>出发城市：</th><td>
		<select name="ship_depart_city">
			<option></option> 
			<foreach name="ship_depart_city" item="v">
				<option value={$v}
				<if condition="$product.ship_depart_city eq $v">selected</if>
				>{$v}</option>
			</foreach>
		</select></td></tr>
		<tr class="bg-grey"><th>邮轮航线：</th><td>
		<select name="ship_route">
			<option></option> 
			<foreach name="ship_route" item="v">
				<option value={$v}
				<if condition="$product.ship_route eq $v">selected</if>
				>{$v}</option>
			</foreach>
		</select></td></tr>
		<tr class="bg-grey"><th>邮轮公司：</th><td>
		<select name="ship_company">
			<option></option> 
			<foreach name="ship_company" item="v">
				<option value={$v}
				<if condition="$product.ship_company eq $v">selected</if>
				>{$v}</option>
			</foreach>
		</select></td></tr>
		<tr class="bg-grey"><th>船名：</th><td>
		<select name="ship_name">
			<option></option> 
			<foreach name="ship_name" item="v">
				<option value={$v}
				<if condition="$product.ship_name eq $v">selected</if>
				>{$v}</option>
			</foreach>
		</select></td></tr>
		<tr class="bg-grey"><th>出游日期：</th><td>
		<select name="ship_depart_time">
			<option></option> 
			<foreach name="ship_depart_time" item="v">
				<option value={$v}
				<if condition="$product.ship_depart_time eq $v">selected</if>
				>{$v}</option>
			</foreach>
		</select></td></tr>
		<!--邮轮必填 end -->
		</if>
		
		
		
		<tr><th>出发城市：</th><td><input type="text" name="start" value="{$product.start}" class="big"></td></tr>
		<tr><th>途径城市：</th><td><input type="text" name="path" value="{$product.path}" class="big"></td></tr>
		<tr><th>目的地城市：</th><td><input type="text" name="end" value="{$product.end}" class="big"></td></tr>
		
		<tr><th>产品亮点：</th><td><input type="text" name="highlight1" class="big" value="{$product.highlight1}"></td></tr>
		<tr><th></th><td><input type="text" name="highlight2" class="big" value="{$product.highlight2}"></td></tr>
		<tr><th></th><td><input type="text" name="highlight3" class="big" value="{$product.highlight3}"></td></tr>
		<tr><th></th><td>产品亮点请填写：例如【欧洲最美小镇】、【音乐之声仙境】、【彩色波希米亚风】等，每行不超过20个字<td></tr>
		
		<tr><th>出游日期：</th><td><input size="16" type="text" value="{$product.start_time}"  class="form_datetime" name="start_time" ></td></tr>
		<tr><th>服务语言：</th><td><input type="text" name="language" value="{$product.language}"></td></tr>
		<tr><th>出游人群：</th><td><input type="text" name="people" value="{$product.people}"></td></tr>
		
		<tr><th>供应商报价：</th><td><input type="text" name="price" class="small" value="{$product.price}"> 元 （必填）</td></tr>
		<tr><th></th><td>最终产品价格 = 供应商报价 × (1 + 产品信息费% - 产品优惠额%)<td></tr>
		<tr><th>门市价：</th><td><input type="text" name="market_price" class="small" value="{$product.market_price}"> 元</td></tr>
		<tr><th></th><td>提示：填写价格请严格遵守法律规定、遵守市场规律，确保可以提供该价格的合法依据或可供比较的出处，不得虚构原价。<td></tr>
		<tr><th>儿童价：</th><td><input type="text" name="child_price" class="small" value="{$product.child_price}"> 元</td></tr>
		<tr><th>套餐一：</th><td>名称：<input type="text" name="plan1_name" class="small" value="{$product.plan1_name}"> 价格：<input type="text" name="plan1_price" class="small" value="{$product.plan1_price}"> 元（供应商报价）</td></tr>
		<tr><th>套餐二：</th><td>名称：<input type="text" name="plan2_name" class="small" value="{$product.plan2_name}"> 价格：<input type="text" name="plan2_price" class="small" value="{$product.plan2_price}"> 元</td></tr>
		<tr><th>套餐三：</th><td>名称：<input type="text" name="plan3_name" class="small" value="{$product.plan3_name}"> 价格：<input type="text" name="plan3_price" class="small" value="{$product.plan3_price}"> 元</td></tr>
		<tr><th>套餐四：</th><td>名称：<input type="text" name="plan4_name" class="small" value="{$product.plan4_name}"> 价格：<input type="text" name="plan4_price" class="small" value="{$product.plan4_price}"> 元</td></tr>
		<tr><th>套餐五：</th><td>名称：<input type="text" name="plan5_name" class="small" value="{$product.plan5_name}"> 价格：<input type="text" name="plan5_price" class="small" value="{$product.plan5_price}"> 元</td></tr>
		<tr><th>套餐六：</th><td>名称：<input type="text" name="plan6_name" class="small" value="{$product.plan6_name}"> 价格：<input type="text" name="plan6_price" class="small" value="{$product.plan6_price}"> 元</td></tr>
		<tr><th>产品信息费：</th><td><input type="text" name="info_fee" class="small" value="{$product.info_fee}"> %</td></tr>
		<tr><th>产品优惠额：</th><td><input type="text" name="discount" class="small" value="{$product.discount}"> %</td></tr>
		
		<tr><th>定金：</th><td><input type="text" name="deposit" class="small" value="{$product.deposit}"> 元</td></tr>
		<tr><th>产品库存：</th><td><input type="text" name="stock" class="small" value="{$product.stock}">（必填）</td></tr>
		<tr><th>促销活动：</th><td><input type="text" name="promotion" value="{$product.promotion}"></td></tr>



		
		<tr><th>二次确认：</th><td><select name="confirm">
			<option value="yes" <eq name="product.confirm" value="yes">selected</eq>>是</option>
				<option value="no" <eq name="product.confirm" value="no">selected</eq>>否</option>
		</select></td></tr>
		
		<tr><th>是否上架：</th><td><select name="on_sale">
			<option value="yes" <eq name="product.on_sale" value="yes">selected</eq>>是</option>
				<option value="no" <eq name="product.on_sale" value="no">selected</eq>>否</option>
		</select></td></tr>
		
		<eq name="priv" value="0">	
			<tr><th>是否推荐：</th><td><select name="recommend">
				<option value="yes" <eq name="product.recommend" value="yes">selected</eq>>是</option>
				<option value="no" <eq name="product.recommend" value="no">selected</eq>>否</option>
			</select></td></tr>
		</eq>
		<tr><th>缩略图：</th><td><input type="file" name="thumb" class="btn btn-default"/>分辨率400*400以上，大小2M以内</td></tr>
		<tr><th>当前图片：</th><td>
			<empty name="product.thumb">
				<img src="__PUBLIC__/Common/img/preview.jpg">
			<else/>
				<img src="__PUBLIC__/Uploads/small/{$product.thumb}">
			</empty>
		</td></tr>
		<tr><th>焦点图1：</th><td><input type="file" name="pic1" class="btn btn-default"/>分辨率690*400以上，大小2M以内</td></tr>
		<tr><th>当前图片：</th><td>
			<empty name="product.pic1">
				<img src="__PUBLIC__/Common/img/preview.jpg">
			<else/>
				<img src="__PUBLIC__/Uploads/focus/{$product.pic1}">
			</empty>
		</td></tr>
		<tr><th>焦点图2：</th><td><input type="file" name="pic2" class="btn btn-default"/></td></tr>
		<tr><th>当前图片：</th><td>
			<empty name="product.pic2">
				<img src="__PUBLIC__/Common/img/preview.jpg">
			<else/>
				<img src="__PUBLIC__/Uploads/focus/{$product.pic2}">
			</empty>
		</td></tr>
		<tr><th>焦点图3：</th><td><input type="file" name="pic3" class="btn btn-default"/></td></tr>
		<tr><th>当前图片：</th><td>
			<empty name="product.pic3">
				<img src="__PUBLIC__/Common/img/preview.jpg">
			<else/>
				<img src="__PUBLIC__/Uploads/focus/{$product.pic3}">
			</empty>
		</td></tr>
		<tr><th>焦点图4：</th><td><input type="file" name="pic4" class="btn btn-default"/></td></tr>
		<tr><th>当前图片：</th><td>
			<empty name="product.pic4">
				<img src="__PUBLIC__/Common/img/preview.jpg">
			<else/>
				<img src="__PUBLIC__/Uploads/focus/{$product.pic4}">
			</empty>
		</td></tr>
		<tr><th>焦点图5：</th><td><input type="file" name="pic5" class="btn btn-default"/></td></tr>
		<tr><th>当前图片：</th><td>
			<empty name="product.pic5">
				<img src="__PUBLIC__/Common/img/preview.jpg">
			<else/>
				<img src="__PUBLIC__/Uploads/focus/{$product.pic5}">
			</empty>
		</td></tr>
	</table>
	<div class="editor">
	<p>产品详情：</p>
		<include file="Product/_editor" />
		<script type="text/plain" id="myEditor" name="desc">{$product.desc}</script>
	</div>
	<div class="editor">
	<p>行程参考：</p>
		<script type="text/plain" id="myEditor2" name="travel_ref">{$product.travel_ref}</script>
	</div>
	<div class="editor">
	<p>费用说明：</p>
		<script type="text/plain" id="myEditor3" name="cost_desc">{$product.cost_desc}</script>
	</div>
	<div class="editor">
	<p>预定须知：</p>
		<script type="text/plain" id="myEditor4" name="reserve_notice">{$product.reserve_notice}</script>
	</div>
	<div class="editor">
	<p>改退规定：</p>
		<script type="text/plain" id="myEditor5" name="restrict">{$product.restrict}</script>
	</div>
	<div class="editor">
	<p>问题咨询：</p>
		<script type="text/plain" id="myEditor6" name="info">{$product.info}</script>
	</div>
	<div class="btn1">
		<button type="submit" class="btn btn-primary" ><i class="icon-save"></i> 确认修改</button>
	</div>
	</form>
</div>
<script>
	//下拉菜单跳转
	$("#category").change(function(){
		var url = "{:U('Product/edit',array('id'=>$id,'cid'=>'_ID_','p'=>$p))}";
		location.href = url.replace("_ID_",$(this).val());
	});
	//time-picker
	$(".form_datetime").datetimepicker({
		
		format: 'yyyy-mm-dd',
        weekStart: 1,
        todayBtn:  1,
		autoclose: 1,
		todayHighlight: 1,
		startView: 2,
		minView: 2,
		forceParse: 0
	
	});
</script>